/**
 * 
 */
package com.home.emp.web;

/**
 * @author xprk339
 *
 */
import javax.servlet.http.HttpServletRequest;

import org.springframework.web.servlet.mvc.multiaction.MethodNameResolver;
import org.springframework.web.servlet.mvc.multiaction.NoSuchRequestHandlingMethodException;

//TODO to be consolidated
public class NoMethodNameResolver implements MethodNameResolver 
{
	MethodNameResolver mnr = null;
	String methodName = null;
	
	public NoMethodNameResolver(MethodNameResolver mnr,String defaultMethod) {
		this.mnr = mnr;
		this.methodName = defaultMethod;
	}
	public String getHandlerMethodName(HttpServletRequest req)
			throws NoSuchRequestHandlingMethodException {
		String method = null;
		try {
			method = mnr.getHandlerMethodName(req);
		}catch(NoSuchRequestHandlingMethodException exp) {
			method = methodName;
		}		
		return method;
	}
}
